#include <stdio.h>
double getAverage(int *arr, int size);/* 函数声明 */
int main ()
{
    int balance[5] = {1000, 2, 3, 17, 50}; /* 带有 5 个元素的整型数组  */
    double avg;
    avg = getAverage( balance, 5 ) ;/* 传递一个指向数组的指针作为参数 */
    printf("Average value is: %f\n", avg ); /* 输出返回值  */
    return 0;
}

double getAverage(int *arr, int size)
{
    int    i, sum = 0;
    double avg;
    for (i = 0; i < size; ++i)
    {
        sum += arr[i];
    }
    avg = (double)sum / size;
    return avg;
}




